import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class PromptAction {
  static showSuccess(String message) {
    Fluttertoast.showToast(
        msg: message,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER, // 修改为居中
        timeInSecForIosWeb: 1,
        backgroundColor: const Color(0xFF8ccf17),
        // 适配web端背景色
        webBgColor: '#8ccf17',
        webPosition: 'center',
        textColor: Colors.white,
        fontSize: 16.0);
  }

  static showError(String message) {
    Fluttertoast.showToast(
        msg: message,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER, // 修改为居中
        timeInSecForIosWeb: 1,
        backgroundColor: const Color(0xFFe4495b),
        // 适配web端背景色
        webBgColor: '#e4495b',
        webPosition: 'center',
        textColor: Colors.white,
        fontSize: 16.0);
  }

  static showInfo(String message) {
    Fluttertoast.showToast(
        msg: message,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER, // 修改为居中
        timeInSecForIosWeb: 1,
        backgroundColor: const Color(0xFF2f8ef4),
        // 适配web端背景色
        webBgColor: '#2f8ef4',
        webPosition: 'center',
        textColor: Colors.white,
        fontSize: 16.0);
  }
}
